<script setup lang="ts">
defineProps<{
  modelValue: number
  car: string
  house: string
}>()

const emit = defineEmits<{
  (e: 'update:modelValue', money: number): void
  (e: 'update:car', car: string): void
  (e: 'update:house', house: string): void
}>()
</script>

<template>
  <div class="child-page">
    <div>
      <p>钱包: {{ modelValue }}</p>
      <button @click="emit('update:modelValue', modelValue + 30000)">
        搬砖一个月
      </button>
    </div>
    <p>-------------------</p>
    <div>
      <p>车: {{ car }}</p>
      <button @click="emit('update:car', '劳斯劳斯')">换车</button>
    </div>
    <p>-------------------</p>
    <div>
      <p>房: {{ house }}</p>
      <button @click="emit('update:house', '大別野')">换房</button>
    </div>
  </div>
</template>

<style lang="scss" scoped></style>
